<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 引入Boostrap的css文件 -->
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.min.css">
    <!-- 引入Boostrap的表单验证文件 -->    
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.min.css">
    <!-- 引入进度条插件的css文件 -->    
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <!-- 引入jQuery的js文件 -->
    <script src="./lib/jquery/jquery.min.js"></script>
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
    <!-- jquery文件上传插件 -->
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <!-- 模板引擎 -->
    <script src="./lib/artTemplate/template-web.js"></script>
    <!-- boostrap的js文件 -->
    <script src="./lib/bootstrap/js/bootstrap.js"></script>
    <!-- boostrap分页插件 -->
    <script src="./lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <!-- boostrap表单验证 -->
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
    <!-- echarts -->
    <script src="./lib/echarts/echarts.min.js"></script>
    <!-- 进度条 -->
    <script src="./lib/nprogress/nprogress.js"></script>
    <!--公用css和js  -->
    <link rel="stylesheet" href="./css/common.css">
    <script src="./js/common.js"></script>
    <!-- 当前页面css和js -->
    <link rel="stylesheet" href="./css/subcategory.css">
     <script src="./js/subcategory.js"></script>

</head>
<body>
    <div class="main">
        <div class="left ">
            <div class="title">
                <a href="#">黑马12期</a>
            </div>
            <div class="administrator">
                <img src="./images/default.png" alt="">
                <p>超级管理员</p>
            </div>
            <ul class="menu">
                <li>
                    <a href="./users.html">
                        <span class="glyphicon glyphicon-user"></span>用户管理</a>
                </li>
                <li>
                    <a href="javascript:void(0)" class="slideToggle">
                        <span class="glyphicon glyphicon-list"></span>分类管理</a>
                    <div class="submenu">
                        <a href="./category1.html">一级分类</a>
                        <a href="./subcategory.html" class="active">二级分类</a>
                    </div>
                </li>
                <li>
                    <a href="javascript:void(0)">
                        <span class="glyphicon glyphicon-tags"></span>商品管理</a>
                </li>
    
            </ul>
    
        </div>
        <div class="right">
            <div class="topBar">
                <a href="javascript:void(0)" class="pull-left toggle-menu"><span class="glyphicon glyphicon-align-justify"></span></a>
                <a href="javascript:void(0)" class="pull-right login-out"><span class="glyphicon glyphicon-log-out"></span></a>
            </div>
            <ol class="breadcrumb pageNav">
                <li>
                    <a href="#">管理系统</a>
                </li>
                <li class="active">首页</li>
               
            </ol>
           
            <div class="content container-fluid">
                <button class="btn btn-default add-subcategory">添加分类</button>
                    <table class="table table-bordered table-hover ">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>一级分类名称</th>
                                <th>二级分类名称</th>
                                <th>二级分类LOGO</th>
                                
                            </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>1</td>
                            <td>女士馆</td>
                            <td>花蛤</td>
                            <td><img src="" alt=""></td>
                            
                        </tr>
                        </tbody>
                    </table>
    
                    <!-- 分页插件 -->
                    <div class="text-right">
                        <ul id="paginator"></ul>
                    </div>
                </div>
        </div>
    </div>
    <!-- 二级分类信息模板 -->
    <script id="subcategory-table" type="text/html">
                
            {{each rows}}
                <tr>
                    <!-- <td>{{(page-1)*size+$value.index+1}}</td> -->
                    <td>{{(page-1)*size+$index+1}}</td>
                    <td>{{$value.categoryName}}</td>
                    <td>{{$value.brandName}}</td>
                    <td><img src="{{$value.brandLogo}}" alt="" height="40"></td>
    
                </tr>
                {{/each}}
    
        
    </script>
       <!-- 二级分类下拉框的模板 -->
       <script id="subcategory" type="text/html">
        {{each rows}}
        <li>
            <a href="script:void(0)" data-id="{{$value.id}}">{{$value.categoryName}}</a>
        </li>
        {{/each}}
        
       </script>

    <!-- 退出模态框 -->
    <div id="myModal" class="modal fade" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-sm" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">温馨提示</h4>
                </div>
                <div class="modal-body">
                    <p>
                        <span class="glyphicon glyphicon-info-sign"></span>您确定要退出管理系统吗?&hellip;</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary btn-loginout">确定</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 添加二级分类模态框 -->
    <div id="addCategory" class="modal fade" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-sm" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">添加二级分类</h4>
                </div>
                <div class="modal-body">
    
                    <form method="POST" accept-charset="UTF-8">
                        <div class=" form-group dropdown">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true"
                                aria-expanded="true">
                                一级分类
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                               
                            </ul>
                            <!-- 需要提交给服务器的不是一级分类的名称,而是对应的id,所以用一个隐藏的input将id存起来 -->
                            <input type="hidden" name="categoryId">
                        </div>
                        <div class="form-group">
    
                            <input type="text" class="form-control" id="InputSubcategory" placeholder="请输入二级分类" name="brandName">
                        </div>
                        <div class="form-group file-group">
                            
                                <input type="file" id="fileupload" name="pic1" data-url="/category/addSecondCategoryPic">
                                <button class="btn btn-default" type="button" >上传图片</button>
                               
 
                        </div>
                        <div class="form-group">
                                <img src="" alt="" class="picAddr" >
                                <input type="hidden" name="brandLogo" > 
 
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary btn-addButton">确定</button>
                </div>
            </div>
        </div>
    </div>
 
</body>
</html>
